package com.example.smart_campus.pojo.entity;

import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.relational.core.mapping.Table;

import java.io.Serializable;

/**
 * <p>
 * 校园卡消费记录表，存储校园卡的消费记录
 * </p>
 *
 * @author liyv
 * @since 2024-10-19
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Table("card_transactions")
public class CardTransactions implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 交易ID，主键
     */
    @TableId(value = "transaction_id", type = IdType.AUTO)
    private Integer transactionId;

    /**
     * 校园卡ID，外键
     */
    private Integer cardId;

    /**
     * 交易日期
     */
    private LocalDateTime transactionDate;

    /**
     * 交易地点
     */
    private String location;

    /**
     * 交易金额
     */
    private BigDecimal amount;


    @Override
    public String toString() {
        return "CardTransactions{" +
        "transactionId=" + transactionId +
        ", cardId=" + cardId +
        ", transactionDate=" + transactionDate +
        ", location=" + location +
        ", amount=" + amount +
        "}";
    }
}
